Allow 'undo-redo' to be called from Lisp without repeat count
authorTom Levy <tomlevy93@gmail.com>
Tue, 9 Nov 2021 12:05:28 +0000 (12:05 +0000)
committerLars Ingebrigtsen <larsi@gnus.org>
Wed, 10 Nov 2021 00:12:47 +0000 (01:12 +0100)
* lisp/simple.el (undo-redo): Default arg to 1 to avoid error when
called from Lisp without args (bug#51718).

Copyright-paperwork-exempt: yes

lisp/simple.el

index 82e373be9e603820e97f9774bca830732dc5e4a3..ad6d28cb14db5567a643217050f3558f2436f275 100644 (file)
@@ -3114,7 +3114,7 @@ Interactively, ARG is the prefix numeric argument and defaults to 1."
             (let ((undo-in-progress t))
               (while (and (consp ul) (eq (car ul) nil))
                 (setq ul (cdr ul)))
-              (primitive-undo arg ul)))
+              (primitive-undo (or arg 1) ul)))
            (new-pul (undo--last-change-was-undo-p new-ul)))
       (message "Redo%s" (if undo-in-region " in region" ""))
       (setq this-command 'undo)